package com.yi.servicedriveruser.controller;


import com.yi.internalcommon.dto.ResponseResult;
import com.yi.internalcommon.dto.DriverUserWorkStatus;
import com.yi.servicedriveruser.service.DriverUserWorkStatusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

/**
 * <p>
 * 司机工作状态表 前端控制器
 * </p>
 *
 * @author 田毅
 * @since 2022-12-04
 */
@RestController
public class DriverUserWorkStatusController {

    @Autowired
    DriverUserWorkStatusService driverUserWorkStatusService;

    @PostMapping("/driver-user-work-status")
    public ResponseResult changeWorkStatus(@RequestBody DriverUserWorkStatus driverUserWorkStatus){
        Long driverId = driverUserWorkStatus.getDriverId();
        Integer workStatus = driverUserWorkStatus.getWorkStatus();
        return driverUserWorkStatusService.changeWorkStatus(driverId,workStatus);
    }
}
